package team.fjut.cf.pojo.enums;

/**
 * 实名认真类型
 *
 * @author pyb [20121/3/24]
 */
public enum AuthType {
    MODIFY(0,"申请修改资料"),
    ACMACTIVE(1,"认证为ACM集训队员"),
    ACMRETIRE(2,"申请ACM退役"),
    ZSJCMEMBER(3,"认证为中世竞创协会成员"),
    FJUTSTUDENT(4,"认证为FJUT在校学生"),
    OTHERSTUDENT(5,"认证为其他学校学生");


    private Integer code;
    private String type;

    AuthType(int code, String type) {
        this.code=code;
        this.type=type;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static String getTypeByCode(Integer C){
        for(AuthType T : AuthType.values()){
            if(C == T.getCode()){
                return T.getType();
            }
        }
        return null;
    }

    public static Integer getCodeByType(String T){
        for(AuthType C : AuthType.values()){
            if(T.equals(C.getType())){
                return C.getCode();
            }
        }
        return null;
    }
}
